<%@ page language="java" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
		<!-- 全局js -->
	    <script src="${path}/assets/hplus/js/jquery.min.js?v=2.1.4"></script>
	    <script src="${path}/assets/hplus/js/bootstrap.min.js?v=3.3.6"></script>
	    <script src="${path}/assets/hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
	    <script src="${path}/assets/hplus/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	    <script src="${path}/assets/hplus/js/plugins/layer/layer.min.js"></script>
	    <script src="${path}/assets/hplus/js/plugins/sweetalert/sweetalert.min.js"></script>
	    <script src="${path}/assets/hplus/js/plugins/layer/layer.min.js"></script>
	    <script src="${path}/assets/hplus/js/plugins/iCheck/icheck.min.js"></script>
	    <script src="${path}/assets/hplus/js/plugins/validate/jquery.validate.min.js"></script>
        <script src="${path}/assets/hplus/js/plugins/validate/messages_zh.min.js"></script>
        <script src="${path}/assets/hplus/js/plugins/sweetalert/sweetalert.min.js"></script>
        <script src="${path}/assets/js/plugins/suggest0.1.26/bootstrap-suggest.min.js"></script>
        <script src="${path}/assets/js/plugins/suggest0.1.26/tether.min.js"></script>
        <script src="${path}/assets/js/content.min.js"></script>
        <script src="${path}/assets/js/plugins/jQuery-Autocomplete-master/dist/jquery.autocomplete.js"></script>
	    <!-- 自定义js -->
	    <script src="${path}/assets/js/app.js"></script>
	    <script src="${path}/assets/js/jquery.editable-select.js"></script>
	    <script src="${path}/assets/js/app.js"></script>
	    <script src="${path}/assets/js/plugins/jquery.form.min.js"></script>
	    <script type="text/javascript" src="${path}/assets/hplus/js/plugins/layer/laydate/laydate.js"></script>
        <!-- jqGrid -->
    	<script src="${path}/assets/hplus/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
    	<script src="${path}/assets/hplus/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
    	<script>
    		 var ctx = '${path}';
    	</script>
		<script src="${path}/assets/js/common.js"></script>
	    <script>
	       
		    $.validator.setDefaults({
	            highlight: function (element) {
	                $(element).closest('.form-group').removeClass('has-success').addClass('has-error');
	            },
	            success: function (element) {
	                element.closest('.form-group').removeClass('has-error').addClass('has-success');
	            },
	            errorElement: "span",
	            errorPlacement: function (error, element) {
	                if (element.is(":radio") || element.is(":checkbox")) {
	                    error.appendTo(element.parent().parent().parent());
	                } else {
	                    error.appendTo(element.parent());
	                }
	            },
	            errorClass: "help-block m-b-none",
	            validClass: "help-block m-b-none"
	        });
		    
		    
		    function mylaydate(inputId) {

		    	laydate({
					elem : "#" + inputId,
					event : "focus",
				});
		    }
			//图片上传-需要配合隐藏域使用
			//0-不限制文件类型；1-图片；2-文件文档
			function uploadImage(filed,type,formId) {
				
				var imageId = $(filed).attr("id");
				
				$("#" + formId).ajaxSubmit({
					url : "${path }/index/upload",
					type : "post",
					dataType : "json",
					data:{imageId : imageId,type:type,time:Math.random() },
					timeout : 60000,
					success : function(data, textStatus) {
						if(data.code == 1) {
							$("#" + imageId.substr(0,imageId.length - 1)).val(data.path);
						} else {
							swal(data.message);
						}
					},error : function(data, textStatus) {
						swal(data.message);
					}
				});
				
			}
            function getDays(startDate, endDate) {
                var date1Str = startDate.split("-");//将日期字符串分隔为数组，数组元素分别为年、月、日
				//根据年、月、日的值创建Date对象
                var date1Obj = new Date(date1Str[0], (date1Str[1] - 1), date1Str[2]);
                var date2Str = endDate.split("-");
                var date2Obj = new Date(date2Str[0], (date2Str[1] - 1), date2Str[2]);
                var t1 = date1Obj.getTime();//返回从1970-1-1开始计算到Date对象中的时间之间的毫秒数
                var t2 = date2Obj.getTime();//返回从1970-1-1开始计算到Date对象中的时间之间的毫秒数
                var datetime = 1000 * 60 * 60 * 24; //一天时间的毫秒值
                var minusDays = Math.floor(((t2 - t1) / datetime));//计算出两个日期天数差
                var days = minusDays;//如果结果为负数，取绝对值
                return days;
            }
	    </script>
